﻿
namespace State
{
    class NightState : IState
    {
        private static NightState singleton = new NightState();

        private NightState()
        {
        }

        public static IState GetInstance()
        {
            return singleton;
        }

        public override string ToString()
        {
            return "[夜間]";
        }

        #region IState メンバ

        public void DoClock(IContext context, int hour)
        {
            if (9 <= hour || hour < 17)
            {
                context.ChangeState(DayState.GetInstance());
            }
        }

        public void DoUse(IContext context)
        {
            context.RecordLog("金庫使用(夜間)");
        }

        public void DoAlarm(IContext context)
        {
            context.CallSecurityCenter("非常ベル(夜間)");
        }

        public void DoPhone(IContext context)
        {
            context.CallSecurityCenter("通常の電話(夜間)");
        }

        #endregion
    }
}
